package com.itheima.stock.job;

import com.itheima.stock.service.StockTimerTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class jobhandler {

    @Autowired
    private StockTimerTaskService stockTimerTaskService;

        @XxlJob("hema_job_test")
        public void jobTest() {
            System.out.println("jobTest run.....");
        }
    /**
     * 定义定时任务，采集国内大盘数据
     */
    @XxlJob("getStockInnerMarketInfos")
    public void getStockInnerMarketInfos(){
        stockTimerTaskService.getInnerMarketInfo();
    }

    /**
     * 定时采集A股数据
     */
    @XxlJob("getStockInfos")
    public void getStockInfos(){
        stockTimerTaskService.getStockRtIndex();}

    /**
     * 板块定时任务
     */
    @XxlJob("getStockBlockRtInfo")
    public void getStockBlockRtInfo(){
        stockTimerTaskService.getStockBlockRtInfo();
    }


}
